
/*
 *
 *  Copyright (C) 2012-2024
 *  All rights reserved, Designed By 杭州连线客信息技术有限公司
 *  注意：
 *  本软件为杭州连线客信息技术有限公司开发研制，未经购买不得使用
 *  购买后可获得全部源代码（禁止转卖、分享、上传到码云、github等开源平台）
 *  一经发现盗用、分享等行为，将追究法律责任，后果自负
 *
 */

package com.lxk.oms.order.service.impl;

import com.lxk.oms.log.domain.bo.OmsCommonOrderLogBo;
import com.lxk.oms.log.service.IOmsCommonOrderLogService;
import com.lxk.service.oms.api.OrderOptionLogServiceApi;
import com.lxk.service.oms.dto.OrderOptionLogDto;
import lombok.RequiredArgsConstructor;
import org.dromara.common.tenant.helper.TenantHelper;
import org.springframework.stereotype.Service;

/**
 * 交易订单Service业务层处理
 *
 * @author huahua
 * @date 2024-08-19
 */
@RequiredArgsConstructor
@Service
public class OrderOptionLogServiceApiImpl implements OrderOptionLogServiceApi {

    private final IOmsCommonOrderLogService omsCommonOrderLogService;

    public void insertLog(OrderOptionLogDto dto) {
        TenantHelper.dynamic(dto.getTenantId(), () -> {
            OmsCommonOrderLogBo add = new OmsCommonOrderLogBo();
            add.setMerId(dto.getMerId());
            add.setUserId(dto.getUserId());
            add.setContent(dto.getContent());
            add.setLogType(dto.getOrderLogEnums());
            add.setUserType(dto.getUserType());
            add.setOmsSn(dto.getOrderSn());
            omsCommonOrderLogService.insertByBo(add);
        });
    }
}
